package com.zidongxiangxi.clock.server.listener;

import com.zidongxiangxi.clock.server.manager.ClockWorkThreadManger;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 工作线程管理类
 *
 * @author chenxudong
 * @date 2020/07/22
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class ApplicationStartedListener implements ApplicationListener<ApplicationStartedEvent> {
    private final ClockWorkThreadManger clockWorkThreadManger;

    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        clockWorkThreadManger.start();
    }

}
